const getRows = (req, res) => {
    let list = [];
    for(let i=1;i<11;i++){
        list.push({
            "id": i,
            "productId": i%2==0?1:4,
            "productName": "测试产品001",
            "productKey": "DC.DQrgZ9peRACqU7Oaa2mX9A",
            "deviceId": "b3fbef1ca2c44a5598ab7c5c0266e651",
            "deviceSn": "202202022000"+i,
            "deviceName": "测试设备00"+i,
            "nickName": "1",
            "authType": 1,
            "deviceSecret": "DC.ynpMXlEbSTaNWHm23XG73A",
            "deviceKey": "DC.63Ao6WHsRbG16paFwcbIbA",
            "status": i%2==0?1:2,
            "version": '1.0.0.10',
            "newVersion": '1.0.0.11',
            "createTime": 1637212376507,
            "activeTime": 1640055075350,
            "lastOnlineTime": 1650972825864,
            "remark": null,
            "gmtCreated": 1637212375526,
            "gmtModified": 1650972832731
        });
    }
    list.reverse();

    res.json ({
        success:true,
        errorCode:null,
        errorMessage:null,
        data:{
            rows:list,
            total:10
            
        },
        ts:1653544105
    })
}

export default {
    'GET /api/device/list':getRows,
    'GET /api/device/1':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:{
            "id": 1,
            "productId": 1,
            "productName": "测试产品001",
            "productKey": "DC.DQrgZ9peRACqU7Oaa2mX9A",
            "deviceId": "b3fbef1ca2c44a5598ab7c5c0266e651",
            "deviceSn": "2022020220001",
            "deviceName": "测试设备001",
            "nickName": "1",
            "authType": 1,
            "deviceSecret": "DC.ynpMXlEbSTaNWHm23XG73A",
            "deviceKey": "DC.63Ao6WHsRbG16paFwcbIbA",
            "status": 1,
            "version": '1.0.0.10',
            "newVersion": '1.0.0.11',
            "createTime": 1637212376507,
            "activeTime": 1640055075350,
            "lastOnlineTime": 1650972825864,
            "remark": null,
            "gmtCreated": 1637212375526,
            "gmtModified": 1650972832731
        },
        ts:1653544105
    },
    'POST /api/device':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:null,
        ts:1653544105
    },
    'PUT /api/device/1':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:null,
        ts:1653544105
    },
    'DELETE /api/device/1':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:null,
        ts:1653544105
    },
    'PUT /api/device/1/status/1':{
        success:true,
        errorCode:null,
        errorMessage:null,
        data:null,
        ts:1653544105
    },
}
